package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * Created by chenlei on 2017/9/26.
 */
@RestController
@RequestMapping("/customer")
public class CustomerController {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/customHello")
    String customHello(){
        System.out.println("do customHello ");
        return  restTemplate.getForEntity("http://eurekaClient/eureka/hello",String.class).getBody();
    }
}
